<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./chap11_files/filelist.xml">
<link rel=Edit-Time-Data href="./chap11_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title> </title>
<style>
<!--
 /* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
@font-face
	{font-family:"Microsoft Sans Serif";
	panose-1:2 11 6 4 2 2 2 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421663 -2147483648 8 0 66047 0;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:536871559 0 0 0 415 0;}
@font-face
	{font-family:Desdemona;
	panose-1:4 2 5 5 2 14 3 4 5 4;
	mso-font-charset:0;
	mso-generic-font-family:decorative;
	mso-font-pitch:variable;
	mso-font-signature:131 0 0 0 9 0;}
@font-face
	{font-family:Terminal;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:255;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:3 0 0 0 1 0;}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:windowtext;}
h1
	{mso-style-next:Normal;
	margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:1;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	color:black;
	mso-font-kerning:0pt;
	mso-ansi-language:EN-GB;
	font-weight:normal;
	text-decoration:underline;
	text-underline:single;}
h2
	{mso-style-next:Normal;
	margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:center;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:2;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;
	font-weight:normal;
	font-style:italic;
	mso-bidi-font-style:normal;}
h3
	{mso-style-next:Normal;
	margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:3;
	font-size:14.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;
	font-weight:normal;}
h4
	{mso-style-next:Normal;
	margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:4;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;
	font-weight:bold;
	mso-bidi-font-weight:normal;
	text-decoration:underline;
	text-underline:single;}
h5
	{mso-style-next:Normal;
	margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:5;
	font-size:14.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;
	font-weight:bold;
	mso-bidi-font-weight:normal;
	text-decoration:underline;
	text-underline:single;}
h6
	{mso-style-next:Normal;
	margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	text-indent:.5in;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:6;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;
	font-weight:normal;
	font-style:italic;
	mso-bidi-font-style:normal;}
p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
	{mso-style-next:Normal;
	margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:7;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;
	font-style:italic;
	mso-bidi-font-style:normal;}
p.MsoHeading8, li.MsoHeading8, div.MsoHeading8
	{mso-style-next:Normal;
	margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:8;
	font-size:14.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;
	text-decoration:underline;
	text-underline:single;}
p.MsoHeading9, li.MsoHeading9, div.MsoHeading9
	{mso-style-next:Normal;
	margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:center;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:9;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;
	font-weight:bold;
	mso-bidi-font-weight:normal;}
p.MsoIndex1, li.MsoIndex1, div.MsoIndex1
	{mso-style-update:auto;
	mso-style-next:Normal;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:11.0pt;
	margin-bottom:.0001pt;
	text-indent:-11.0pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoIndex2, li.MsoIndex2, div.MsoIndex2
	{mso-style-update:auto;
	mso-style-next:Normal;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:22.0pt;
	margin-bottom:.0001pt;
	text-indent:-11.0pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoIndex3, li.MsoIndex3, div.MsoIndex3
	{mso-style-update:auto;
	mso-style-next:Normal;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:33.0pt;
	margin-bottom:.0001pt;
	text-indent:-11.0pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoIndex4, li.MsoIndex4, div.MsoIndex4
	{mso-style-update:auto;
	mso-style-next:Normal;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:44.0pt;
	margin-bottom:.0001pt;
	text-indent:-11.0pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoIndex5, li.MsoIndex5, div.MsoIndex5
	{mso-style-update:auto;
	mso-style-next:Normal;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:55.0pt;
	margin-bottom:.0001pt;
	text-indent:-11.0pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoIndex6, li.MsoIndex6, div.MsoIndex6
	{mso-style-update:auto;
	mso-style-next:Normal;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:66.0pt;
	margin-bottom:.0001pt;
	text-indent:-11.0pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoIndex7, li.MsoIndex7, div.MsoIndex7
	{mso-style-update:auto;
	mso-style-next:Normal;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:77.0pt;
	margin-bottom:.0001pt;
	text-indent:-11.0pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoIndex8, li.MsoIndex8, div.MsoIndex8
	{mso-style-update:auto;
	mso-style-next:Normal;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:88.0pt;
	margin-bottom:.0001pt;
	text-indent:-11.0pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoIndex9, li.MsoIndex9, div.MsoIndex9
	{mso-style-update:auto;
	mso-style-next:Normal;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:99.0pt;
	margin-bottom:.0001pt;
	text-indent:-11.0pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:center 207.65pt right 415.3pt;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:center 207.65pt right 415.3pt;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoIndexHeading, li.MsoIndexHeading, div.MsoIndexHeading
	{mso-style-next:"Index 1";
	margin-top:12.0pt;
	margin-right:0in;
	margin-bottom:6.0pt;
	margin-left:0in;
	text-align:center;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:15.5pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	font-weight:bold;}
span.MsoFootnoteReference
	{vertical-align:super;}
span.MsoEndnoteReference
	{vertical-align:super;}
p.MsoEndnoteText, li.MsoEndnoteText, div.MsoEndnoteText
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
	{margin:0in;
	margin-bottom:.0001pt;
	text-align:center;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:windowtext;
	font-weight:bold;
	mso-bidi-font-weight:normal;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
	{margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;}
p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent
	{margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:13.5pt;
	margin-bottom:.0001pt;
	text-align:justify;
	text-indent:.65pt;
	mso-pagination:widow-orphan;
	mso-layout-grid-align:none;
	text-autospace:none;
	font-size:9.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;}
p.MsoBodyText2, li.MsoBodyText2, div.MsoBodyText2
	{margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	border:none;
	mso-border-top-alt:solid windowtext 1.5pt;
	mso-border-bottom-alt:solid windowtext 1.5pt;
	padding:0in;
	mso-padding-alt:1.0pt 0in 1.0pt 0in;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;}
p.MsoBodyText3, li.MsoBodyText3, div.MsoBodyText3
	{margin:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	font-size:9.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;}
p.MsoBodyTextIndent2, li.MsoBodyTextIndent2, div.MsoBodyTextIndent2
	{margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:13.5pt;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	mso-layout-grid-align:none;
	text-autospace:none;
	font-size:9.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	mso-ansi-language:EN-GB;}
p.MsoBodyTextIndent3, li.MsoBodyTextIndent3, div.MsoBodyTextIndent3
	{margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:9.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
p.MsoBlockText, li.MsoBlockText, div.MsoBlockText
	{margin-top:0in;
	margin-right:-.35pt;
	margin-bottom:0in;
	margin-left:3.5in;
	margin-bottom:.0001pt;
	text-align:justify;
	text-indent:-3.5in;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
a:link, span.MsoHyperlink
	{mso-style-parent:"";
	color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
strong
	{mso-bidi-font-weight:normal;}
em
	{mso-bidi-font-style:normal;}
p.MsoDocumentMap, li.MsoDocumentMap, div.MsoDocumentMap
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	background:navy;
	font-size:11.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Tahoma;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";
	color:black;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";
	color:windowtext;
	mso-ansi-language:EN-GB;}
p
	{margin-right:0in;
	mso-margin-top-alt:auto;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
span.Typewriter
	{mso-style-name:Typewriter;
	mso-style-parent:"";
	mso-ansi-font-size:10.0pt;
	mso-ascii-font-family:"Courier New";
	mso-hansi-font-family:"Courier New";}
span.l
	{mso-style-name:l;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
@list l0
	{mso-list-id:622225364;
	mso-list-type:hybrid;
	mso-list-template-ids:1722327626 -464728450 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
	{mso-level-start-at:4;
	mso-level-tab-stop:57.75pt;
	mso-level-number-position:left;
	margin-left:57.75pt;
	text-indent:-21.75pt;}
@list l1
	{mso-list-id:742064993;
	mso-list-type:hybrid;
	mso-list-template-ids:-1023002164 1370895038 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
	{mso-level-start-at:5;
	mso-level-number-format:alpha-lower;
	mso-level-tab-stop:32.15pt;
	mso-level-number-position:left;
	margin-left:32.15pt;
	text-indent:-.25in;}
@list l2
	{mso-list-id:1224482138;
	mso-list-type:hybrid;
	mso-list-template-ids:-1479514112 -972418168 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l2:level1
	{mso-level-start-at:4;
	mso-level-tab-stop:54.75pt;
	mso-level-number-position:left;
	margin-left:54.75pt;
	text-indent:-18.75pt;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1027"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]--><!--[if gte mso 9]><xml>
 <u1:DocumentProperties>
  <u1:Author> </u1:Author>
  <u1:Template>Normal</u1:Template>
  <u1:LastAuthor> </u1:LastAuthor>
  <u1:Revision>1</u1:Revision>
  <u1:TotalTime>0</u1:TotalTime>
  <u1:Created>2005-01-15T18:19:00Z</u1:Created>
  <u1:LastSaved>2005-01-15T18:19:00Z</u1:LastSaved>
  <u1:Pages>14</u1:Pages>
  <u1:Words>4055</u1:Words>
  <u1:Characters>23115</u1:Characters>
  <u1:Company> </u1:Company>
  <u1:Lines>192</u1:Lines>
  <u1:Paragraphs>46</u1:Paragraphs>
  <u1:CharactersWithSpaces>28386</u1:CharactersWithSpaces>
  <u1:Version>9.2720</u1:Version>
 </u1:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <u2:WordDocument>
  <u2:DisplayHorizontalDrawingGridEvery>0</u2:DisplayHorizontalDrawingGridEvery>
  <u2:DisplayVerticalDrawingGridEvery>0</u2:DisplayVerticalDrawingGridEvery>
  <u2:UseMarginsForDrawingGridOrigin/>
  <u2:Compatibility>
   <u2:FootnoteLayoutLikeWW8/>
   <u2:ShapeLayoutLikeWW8/>
   <u2:AlignTablesRowByRow/>
   <u2:ForgetLastTabAlignment/>
   <u2:LayoutRawTableWidth/>
   <u2:LayoutTableRowsApart/>
  </u2:Compatibility>
 </u2:WordDocument>
</xml><![endif]-->
</head>

<body bgcolor=silver lang=EN-US link=blue vlink=purple style='tab-interval:
.5in'>

<div class=Section1>

<div align=center>

<table border=0 cellpadding=0 width="80%" bgcolor=white style='width:80.0%;
 mso-cellspacing:1.5pt;background:white;mso-padding-alt:75.0pt 75.0pt 75.0pt 75.0pt'>
 <tr>
  <td width="100%" style='width:100.0%;padding:75.0pt 75.0pt 75.0pt 75.0pt'>
  <p class=MsoTitle align=left style='margin-left:1.0in;text-align:left'><span
  style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  font-weight:normal;mso-bidi-font-weight:bold'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <div align=center>
  <table border=0 cellspacing=0 cellpadding=0 width=432 style='width:4.5in;
   border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;
   mso-padding-alt:0in 5.4pt 0in 5.4pt'>
   <tr>
    <td width=492 valign=top style='width:368.75pt;border:solid windowtext .5pt;
    padding:0in 5.4pt 0in 5.4pt'>
    <p class=MsoTitle align=left style='text-align:left'><span
    style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
    font-weight:normal;mso-bidi-font-weight:bold'><a href="QiPrograms.zip">Download
    Programs</a> <o:p></o:p></span></p>
    </td>
    <td width=492 valign=top style='width:368.75pt;border:solid windowtext .5pt;
    border-left:none;mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
    <p class=MsoTitle align=left style='text-align:left'><span
    style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
    font-weight:normal;mso-bidi-font-weight:bold'><a href="contents.htm">Go to
    Contents Page</a><o:p></o:p></span></p>
    </td>
   </tr>
  </table>
  </div>
  <p class=MsoTitle align=left style='margin-left:1.0in;text-align:left'><span
  style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  font-weight:normal;mso-bidi-font-weight:bold'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoTitle align=left style='margin-left:1.0in;text-align:left'><span
  style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  font-weight:normal;mso-bidi-font-weight:bold'>Note that this HTML page was
  generated from Word 2000.<span style="mso-spacerun: yes">&nbsp; </span>Some
  of the code cannot be pasted into Qi. You are advised to download the program
  files through the above link.<o:p></o:p></span></p>
  <p class=MsoBodyText3 style='margin-left:.5in'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <div style='border-top:solid windowtext 1.5pt;border-left:none;border-bottom:
  solid windowtext 1.5pt;border-right:none;padding:1.0pt 0in 1.0pt 0in'>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1;border:none;mso-border-top-alt:solid windowtext 1.5pt;
  mso-border-bottom-alt:solid windowtext 1.5pt;padding:0in;mso-padding-alt:
  1.0pt 0in 1.0pt 0in'><b><span lang=EN-GB style='font-size:72.0pt;mso-bidi-font-size:
  10.0pt;font-family:Desdemona;mso-ansi-language:EN-GB'>11</span></b><b><span
  lang=EN-GB style='font-size:72.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'> </span></b><b><sup><span lang=EN-GB style='font-size:48.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Defining Types<u3:p></u3:p></span></sup></b></p>
  </div>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>For flexibility, any strongly
  typed</span><!--[if supportFields]><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b style='mso-bidi-font-weight:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>strongly
  typed</span></b><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>language has to allow the user to define types. These types
  are called <b>user-defined types</b>. One way of defining a type </span><span
  lang=EN-GB style='font-family:Symbol;mso-ansi-language:EN-GB'>a</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'> is to give the precise conditions
  under which an object can be proved to inhabit the type </span><span
  lang=EN-GB style='font-family:Symbol;mso-ansi-language:EN-GB'>a</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>.<span style="mso-spacerun:
  yes">&nbsp; </span>In chapter 7, we saw that <i>refinement</i></span><!--[if supportFields]><i
  style='mso-bidi-font-style:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></i><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>refinement</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i><![endif]--><i
  style='mso-bidi-font-style:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>rules</span></span></i><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'> could be used to define this relation of provability</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>provability</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>.<span style="mso-spacerun:
  yes">&nbsp; </span>In Qi, to define a new type </span><span lang=EN-GB
  style='font-family:Symbol;mso-ansi-language:EN-GB'>a</span><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> is to give a set of refinement rules </span><span
  lang=EN-GB style='font-family:Symbol;mso-ansi-language:EN-GB'>G</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'> that define the conditions under
  which a sequent</span><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>sequent</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>of the form </span><span lang=EN-GB style='font-family:
  Symbol;mso-ansi-language:EN-GB'>D </span><span lang=EN-GB style='font-family:
  Terminal;mso-ansi-language:EN-GB'>&gt;&gt;</span><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> <i>E </i>: </span><span lang=EN-GB
  style='font-family:Symbol;mso-ansi-language:EN-GB'>a</span><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> is provable. Languages that borrow on this method
  of defining types I have referred to elsewhere as <b>deductively typed</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>deductively
  typed</span></b><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span></span></span></b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>languages,
  and Qi is, currently, the only language of this kind<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><u><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>11.1 Enumeration Types____________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>The simplest type that may be
  defined by a series of datatype refinement</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>refinement</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>rules is an <b>enumeration</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>enumeration</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>type</span></span></b><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>. An enumeration type is defined by simply list</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>list</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>ing all its inhabitants. Figure
  11.1 defines a type <b>fruit</b> that is coextensive with the fruits of the
  fruit-machine of chapter 2. A notational convenience is that Qi does not require
  typings (i.e. expressions of the form X : A) to be entered with the outer
  brackets in datatype definitions.<span style="mso-spacerun: yes">&nbsp;
  </span>The underlines in figure 11.1 are represented in Qi by 1 or more
  underscores _____.</span><a style='mso-footnote-id:ftn1' href="#_ftn1"
  name="_ftnref1" title=""><span class=MsoFootnoteReference><span lang=EN-GB
  style='font-family:Wingdings;mso-ascii-font-family:"Microsoft Sans Serif";
  mso-hansi-font-family:"Microsoft Sans Serif";mso-ansi-language:EN-GB;
  mso-char-type:symbol;mso-symbol-font-family:Wingdings'><span
  style='mso-char-type:symbol;mso-symbol-font-family:Wingdings'>0</span></span></span></a><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'> <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>The effect of this datatype definition
  is to allow a series of objects to be of more than one type: cherry is both
  of type<b> symbol</b> and of type <b>fruit</b>.<span style="mso-spacerun:
  yes">&nbsp; </span>The identity function of the previous chapter inhabited an
  infinity of types, but there was a most general type to which this function
  belonged (A </span><span lang=EN-GB style='font-family:Symbol;mso-ansi-language:
  EN-GB'>�</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'> A) of which
  all the others were instances.<span style="mso-spacerun: yes">&nbsp;
  </span>The latter property is not a feature of the object cherry, which
  belongs to two types, which are not instances of some more general type.<span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>An object is <b>overload</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>load</span><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'>ed</span></span></b><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> when it inhabits least two of these types, which
  are not substitution instances of a more general type. <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span><span
  lang=EN-GB style='mso-ansi-language:EN-GB'><br clear=all style='mso-special-character:
  line-break;page-break-before:always'>
  </span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(datatype fruit<u3:p></u3:p><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>__________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>cherry : fruit;<u3:p></u3:p><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>_________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>pear : fruit;<u3:p></u3:p><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>___________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>orange : fruit;<u3:p></u3:p><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>_____________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>pineapple : fruit;<u3:p></u3:p><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>__________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>lemon : fruit;)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><b><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></i></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.2pt;mso-ansi-language:
  EN-GB'>Figure 11.1 The datatype </span></i><b><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.2pt;mso-ansi-language:EN-GB'>fruit</span></b><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.2pt;mso-ansi-language:EN-GB'> that
  enumerates the fruits of the fruit machine <u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Simply entering <b>cherry</b> to
  the Qi top level</span><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>top level</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>returns the verdict that <b>cherry : symbol</b>.<span
  style="mso-spacerun: yes">&nbsp; </span>Given that <b>cherry </b>is overload</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>load</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>ed, Qi always defaults to the base
  type if possible. To get Qi to agree that <b>cherry</b> is now also of type <b>fruit</b>,
  a typing must be entered (figure 11.2).<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(1+) cherry<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>cherry : symbol<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(2+) cherry : fruit<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>cherry : fruit<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(3+) apple : fruit<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>type error</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>type error</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure
  11.2<span style="mso-spacerun: yes">&nbsp; </span>Recognising fruits<u3:p></u3:p></span></i></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></i></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><u><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>11.2 Side Conditions________________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>A side condition to a refinement</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>refinement</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>rule is a condition that must be satisfied for the
  refinement rule to be correctly applied, but which is not conveniently
  expressible in sequent</span><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>sequent</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>notation.<span style="mso-spacerun: yes">&nbsp; </span>In
  Qi these are expressed by the <b>if </b>keyword, placed before the refinement
  rule, the keyword itself to be followed by some boolean</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>boolean</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>expression <i>E</i>.<span style="mso-spacerun: yes">&nbsp;
  </span>If <i>E</i> evaluates to <b>false</b> when the refinement rule is
  applied to a proof, then the refinement rule fails in its application (the
  proof is unchanged).<span style="mso-spacerun: yes">&nbsp; </span>Side
  conditions can be used to shorten a definition. Figure 11.3 shows the use of
  a side condition to shorten the definition of the datatype <b>fruit</b>.<span
  style="mso-spacerun: yes">&nbsp; </span><span style="mso-spacerun:
  yes">&nbsp;</span><u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p>&nbsp;<u3:p></u3:p>
  <b>(datatype fruit<u3:p></u3:p></b></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>if (element? Fruit [cherry pear orange pineapple
  lemon])<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>_________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>Fruit : fruit;)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure 11.3
  Using a side condition to simplify a definition<u3:p></u3:p></span></i></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><u><span
  lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>11.3 Synonyms_____________________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>If representing a type takes a lot
  of space, then it makes sense to define it using some shorthand symbol.<span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>Suppose we have a program in
  which tuple</span><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>tuple</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>s of the type <b>(number * number)</b>
  are used as Cartesian co-ordinates.<span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>Rather than continuously write <b>(number * number)</b>
  we may wish to define a type <b>coor</b> to mean the same as <b>(number *
  number).</b><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>The
  synonyms</span><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>synonyms</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  \b </span><![endif]--><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>declaration allows this to be done simply.<span
  style="mso-spacerun: yes">&nbsp; </span>Here is a declaration that <b>coor</b>
  is short for <b>(number * number)</b> and <b>plot</b> is short for <b>(list
  coor).<a style='mso-footnote-id:ftn2' href="#_ftn2" name="_ftnref2" title=""><span
  class=MsoFootnoteReference><span style='mso-special-character:footnote'><![if !supportFootnotes]>[1]<![endif]></span></span></a><span
  class=MsoFootnoteReference>[1]</span><u3:p></u3:p></b></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(synonyms</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>synonyms</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; \b </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>coor (number * number)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>plot [coor])<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure 11.4
  Using the synonyms</span></i><!--[if supportFields]><i style='mso-bidi-font-style:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></i><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>synonyms</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  \b </span><![endif]--><!--[if supportFields]><i style='mso-bidi-font-style:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></i><![endif]--><i
  style='mso-bidi-font-style:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>declaration to create synonyms<u3:p></u3:p></span></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style="mso-spacerun: yes">&nbsp;</span></span><b><u><span
  lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>11.4 Left and Right Rules___________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Suppose we are defining a type <b>details</b>,
  where <b>details</b> is a two element list composed of a string (representing
  a person&#8217;s name) and a number (representing a telephone number). Obviously it
  is sensible to assert.<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></i></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>\ <i>refinement</i></span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span></i></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>refinement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>rule details_right </span></span></i></b><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>\<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><u><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Name : string; Telephone : number;<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>[Name Telephone] : details;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Notice that <b>;</b> follows <b>Name
  : string </b>and <b>Telephone : number</b>, indicating that these are <i>two </i>separate
  goals that must be solved if <b>[Name Telephone] : details</b> is to be
  proved. Let us also assume an obviously true refinement</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>refinement</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>rule.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>\ <i>sequent</i></span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span></i></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>sequent</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'>s refinement</span></span></i></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span></i></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>refinement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>rule \<u3:p></u3:p></span></span></i></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>___________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>X : A
  &gt;&gt; X : A;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>We can now prove <i>a</i><b> :
  string, </b><i>b</i><b> : number &gt;&gt; [</b><i>a b</i><b>] : details.<u3:p></u3:p></b></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>a</span></i><b><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> : string, </span></b><i><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>b</span></i><b><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'> : number &gt;&gt; [</span></b><i><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>a b</span></i><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>] : details</span></b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'> <i>if<u3:p></u3:p></i></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;tab-stops:163.05pt'><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>a</span></i><b><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> : string, </span></b><i><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>b</span></i><b><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'> : number &gt;&gt; </span></b><i><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>a</span></i><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'> : string <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;tab-stops:163.05pt'><b><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>and</span></i></b><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'> </span></b><i><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>a</span></i><b><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'> : string, </span></b><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>b</span></i><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'> : number &gt;&gt; </span></b><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>b</span></i><b><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> : number <span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style="mso-spacerun: yes">&nbsp;</span>(</span></b><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>by <b><i>details_right</i>)</b><u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;tab-stops:163.05pt'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;tab-stops:163.05pt'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>which are both proved by<span
  style="mso-spacerun: yes">&nbsp; </span><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span><b><i>the
  sequent</i></b></span><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><i style='mso-bidi-font-style:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span> XE
  &quot;sequent&quot; </span></i></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'>s refinement</span></span></i></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span>
  XE &quot;refinement&quot; </span></i></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>rule<u3:p></u3:p></span></span></i></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>However <b><i>details_right </i></b>alone
  is not enough.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>Suppose the
  problem to solve is <b>[</b><i>a b</i><b>] </b>:<b> details</b> &gt;&gt;</span><span
  lang=EN-GB style='font-family:Terminal;mso-ansi-language:EN-GB'> </span><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>a</span></i><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> : <b>string. T</b>he <b><i>details_right</i></b></span><!--[if supportFields]><span
  lang=EN-GB style='mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span>
  XE &quot;<b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='mso-ansi-language:EN-GB'>refinement</span></b>&quot; <![endif]--><!--[if supportFields]><span
  lang=EN-GB style='mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>rule supplied does not enable the sequent</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>sequent</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>to be proved, since the assumption, and not the conclusion
  is of the form <b>[</b><i>a b</i><b>] </b><span style="mso-spacerun:
  yes">&nbsp;</span>:<b> details</b>.<span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>To complete</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>complete</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>the identification of the two types a second refinement
  rule is needed.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>\ <i>refinement</i></span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span></i></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>refinement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>rule details _left </span></span></i></b><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>\<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><u><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Name : string, Telephone : number
  &gt;&gt; P;<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>[Name Telephone] : details &gt;&gt;
  P;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Notice that <b>Name : string </b>and
  <b>Telephone : number</b>, are to the left of &gt;&gt; indicating that these
  are <i>two </i>separate assumptions. The proof is now easy.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;tab-stops:163.05pt'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>[</span></b><i><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>a b</span></i><b><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>] </span></b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;</span>:<b> details</b> &gt;&gt;</span><span
  lang=EN-GB style='font-family:Terminal;mso-ansi-language:EN-GB'> </span><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>a</span></i><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> : <b>string<span style="mso-spacerun: yes">&nbsp;
  </span></b><i>if<u3:p></u3:p></i></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;tab-stops:163.05pt'><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>a</span></i><b><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> : string, </span></b><i><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>b</span></i><b><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'> : number &gt;&gt;</span></b><span lang=EN-GB style='font-family:Terminal;
  mso-ansi-language:EN-GB'> </span><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>a</span></i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'> : <b>string<span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
  <b>(</b>by <b><i>details_left</i>)</b><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><u3:p></u3:p></span><span
  lang=EN-GB style='mso-ansi-language:EN-GB'> </span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;tab-stops:163.05pt'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;tab-stops:163.05pt'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>which is itself proved by<span
  style="mso-spacerun: yes">&nbsp; </span><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style="mso-spacerun: yes">&nbsp;</span><b><i>the sequent</i></b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span>
  XE &quot;sequent&quot; </span></i></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'>s refinement</span></span></i></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span>
  XE &quot;refinement&quot; </span></i></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>rule<u3:p></u3:p></span></span></i></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>The two refinement</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>refinement</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>rules, <b><i>details_right</i></b> and <b><i>details_left</i></b>,
  are the <b>right</b> and<b> left</b> refinement rules for the type <b>details</b>.<span
  style="mso-spacerun: yes">&nbsp; </span>In defining a set of refinement rules
  for a datatype D, often we must allow for objects of type D to occur in the <i>assumptions</i>
  of a sequent</span><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>sequent</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>to be proved, (i.e. to the <i>left</i> of the &gt;&gt;) or
  within the <i>conclusion</i> of the sequent (i.e. to the <i>right</i> of the </span><span
  lang=EN-GB style='font-family:Terminal;mso-ansi-language:EN-GB'>&gt;&gt;</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>).<span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>The left and right refinement rules for D describe
  what may be done in such cases.<span style="mso-spacerun: yes">&nbsp;&nbsp;
  </span>The left refinement rules say what we may prove <i>from</i>
  assumptions involving objects of type D, and the right refinement rules what
  is needed <i>to</i> prove conclusions that objects are of type D.<span
  style="mso-spacerun: yes">&nbsp; </span>In Qi, the sequents refinement rule
  is part of its inbuilt type theory (of which more in chapter 13), hence we do
  not have to include this refinement rule in our definition of <b>details</b>.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>Qi
  permits a shorthand for entering left and right rules.<span
  style="mso-spacerun: yes">&nbsp; </span>Instead of writing two rules.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>\ <i>refinement</i></span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span></i></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>refinement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>rule details_right </span></span></i></b><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>\<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><u><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Name : string; Telephone : number;<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>[Name Telephone] : details;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>\ <i>refinement</i></span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span></i></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>refinement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>rule details _left </span></span></i></b><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-style:italic'>\<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><u><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Name : string, Telephone : number
  &gt;&gt; P;<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>[Name Telephone] : details
  &gt;&gt; P;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'>an
  accepted abbreviation is<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Name : string; Telephone : number;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>===========================<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>[Name Telephone] : details;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt'><b><u><span lang=EN-GB
  style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>11.5 Defining
  Recursive Types_<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;
  </span>_____________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>The type binary</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>binary</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>is the type to which all binary numbers belong.<span
  style="mso-spacerun: yes">&nbsp; </span>A binary number will be identified
  with a list</span><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>list</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>of 1s and 0s with [0] and [1] as the simplest binary
  numbers. How might binary be defined as a type?<span style="mso-spacerun:
  yes">&nbsp; </span>[0] and [1] are binary numbers.<span style="mso-spacerun:
  yes">&nbsp; </span>Given any list (cons X (cons Y Z)), this list is binary if
  and only if X is 1 or 0 and (cons Y Z) is binary.<span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>If (cons X (cons Y Z)) is written as [X Y | Z], then
  the definition of this datatype appears in figure 11.5.</span><a
  style='mso-footnote-id:ftn3' href="#_ftn3" name="_ftnref3" title=""><span
  class=MsoFootnoteReference><span lang=EN-GB style='font-family:Wingdings;
  mso-ansi-language:EN-GB'>0<u3:p></u3:p></span></span></a></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>The datatype of binary</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>binary</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>numbers is introduced by stating the refinement</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>refinement</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>rules used to manage proofs involving that datatype.<span
  style="mso-spacerun: yes">&nbsp; </span>The base refinement rule gives the
  simplest case; a list</span><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>list</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>of one element (0 or 1) is a binary number. </span><span
  lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;</span><u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(datatype binary</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>binary</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  .5in'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>if (element?
  X [0 1])<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  .5in'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>_____________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  .5in;mso-outline-level:1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>X :
  zero-or-one;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><u><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>X :
  zero-or-one;<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>[X] : binary</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>binary</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'>;<u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>\ <i>binary_right </i>\<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><u><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>X :
  zero-or-one; Y : binary</span></u></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><u><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span></u></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>binary</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><u><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span></u></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><u><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-bidi-font-weight:bold'>;<u3:p></u3:p></span></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>[X | Y] : binary</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>binary</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'>;<u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>\ <i>binary_left </i>\<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><u><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>X : zero-or-one, [Y | Z] : binary</span></u></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><u><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span></u></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>binary</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><u><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span></u></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><u><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>&gt;&gt; P;<u3:p></u3:p></span></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>[X Y | Z] : binary</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span> </span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>binary</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>&gt;&gt; P;)<u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure 11.5
  Defining the datatype of binary</span></i><!--[if supportFields]><i
  style='mso-bidi-font-style:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></i><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> </span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>XE &quot;</span><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>binary</span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><i
  style='mso-bidi-font-style:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></i><![endif]--><i
  style='mso-bidi-font-style:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>numbers<u3:p></u3:p></span></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>binary_right</span></i></b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'> says how to prove that objects
  are binary; provided that <b>Y </b>is binary and <b>X </b>is either 0 or 1,
  then <b>[X | Y]</b> is binary. <b><i>binary_left</i></b> says <b>[X Y | Z]</b>
  <b>: binary </b>can be replaced as an assumption <b>by X : zero-or-one</b>
  and <b>[Y | Z] : binary</b>. Functions using this datatype can now be defined
  (figure 11.6).<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(27+) (define complement</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>complement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>\<i>calculates the
  complement</i></span></b><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><i style='mso-bidi-font-style:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span></i></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>complement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>of a binary</span></span></i></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span></i></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>binary</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-bidi-font-weight:
  bold;mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>number\<u3:p></u3:p></span></span></i></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>{binary</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>binary</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>- -&gt; binary}<u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>[0] -&gt; [1] <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>[1] -&gt; [0]<span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style="mso-spacerun: yes">&nbsp;</span><u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>[1 N | X] -&gt; [0
  | (complement</span></b><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>complement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>[N | X])] <u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="mso-spacerun:
  yes">&nbsp;&nbsp;</span>[0 N | X] -&gt; [1 | (complement</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>complement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>[N | X])]) <u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>complement</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>complement</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>: (binary</span></span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>binary</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>- -&gt; binary)<u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure
  11.6<span style="mso-spacerun: yes">&nbsp; </span>Operating with the binary</span></i><!--[if supportFields]><i
  style='mso-bidi-font-style:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></i><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>binary</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><i style='mso-bidi-font-style:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span></i><![endif]--><i
  style='mso-bidi-font-style:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-style:italic'><span style="mso-spacerun:
  yes">&nbsp;</span>number datatype<u3:p></u3:p></span></span></i></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><u><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>11.6 Simulating a Calculator_________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>To demonstrate the utility of
  recursive</span><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>recursive</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>types, we will consider the simulation of a simple
  calculator. Our calculator program takes numbers or list</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>list</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>s and evaluates them to a number
  result (figure 11.7).<span style="mso-spacerun: yes">&nbsp; </span>Having
  load</span><!--[if supportFields]><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>load</span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>ed the program and set it running,
  we can calculate the answers to problems like <b>[88.9 + 8.7]</b> and <b>[56.8
  * [45.3 - 21.7]].</b><span style="mso-spacerun: yes">&nbsp; </span><span
  style="mso-spacerun: yes">&nbsp;</span><u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(define do-calculation<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X + Y] -&gt; (+ (do-calculation X)
  (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X - Y] -&gt; (- (do-calculation X)
  (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X * Y] -&gt; (* (do-calculation X)
  (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X / Y] -&gt; (/ (do-calculation X)
  (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>X -&gt; X)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></i></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure 11.7 A
  calculator program written for core </span></i><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>Qi</span><o:p></o:p></p>
  <u3:p></u3:p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>However, as soon as type checking is
  switched on, entering the program produces a type error</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>type error</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>, because <b>do-calculation</b> is
  designed to deal with mixed list</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>list</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>s and strong typing does not allow
  such lists.<span style="mso-spacerun: yes">&nbsp; </span>Recursive types
  provide a way of tackling this problem (figure 11.8). <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(datatype arith-expr<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span><u>X : number;</u></span><u3:p></u3:p></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>X : arith-expr; <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>if (element? Op [+ - * /])<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>X : arith-expr; Y : arith-expr;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>=====================<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X Op Y] : arith-expr;)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure 11.8
  Our first attempt at defining a datatype of arithmetic expressions<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Armed with these datatype rules,
  we attempt to define our calculator (figure 11.9).<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(2+) (define do-calculation<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{arith-expr - -&gt;
  arith-expr}<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[X + Y] -&gt; (+
  (do-calculation X) <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  .5in'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>(do-calculation
  Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[X - Y] -&gt; (-
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[X * Y] -&gt; (*
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[X / Y] -&gt; (/
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>X -&gt; X)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Correctness Check Failure: rule 1
  of do-calculation<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure
  11.9<span style="mso-spacerun: yes">&nbsp; </span>An erroneous attempt to
  produce a type secure calculator<u3:p></u3:p></span></i></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>The <b>do-calculation</b> program
  fails to type check because + produces numbers and not <b>arith-exprs</b> as
  required by our type assignment</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>assignment</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>.<span style="mso-spacerun:
  yes">&nbsp; </span>Suppose we change the type of do-calculation to <b>arith-expr</b>
  </span><span lang=EN-GB style='font-family:Symbol;mso-ansi-language:EN-GB'>�</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'> <b>number</b>. <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span><b><span
  lang=EN-GB style='mso-ansi-language:EN-GB'><br clear=all style='mso-special-character:
  line-break;page-break-before:always'>
  </span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(3+) (define do-calculation<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{arith-expr - -&gt; number}<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[X + Y] -&gt; (+
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[X - Y] -&gt; (-
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[X * Y] -&gt; (*
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[X / Y] -&gt; (/
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>X -&gt; X)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Correctness Check Failure: rule 5
  of do-calculation<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure
  11.10<span style="mso-spacerun: yes">&nbsp; </span>Another erroneous attempt
  to produce a type secure calculator<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Now the final rewrite rule fails to
  typecheck because Qi finds that it cannot prove that the input X is a number
  from the assumption that X is an <b>arith-expr</b> (remember that our rules
  say that all numbers are <b>arith-exprs</b>; not that all <b>arith-exprs</b>
  are numbers).<span style="mso-spacerun: yes">&nbsp; </span></span><o:p></o:p></p>
  <u3:p></u3:p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Our solution is used within the
  SML</span><!--[if supportFields]><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>ML</span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span><span
  style="mso-spacerun: yes">&nbsp;</span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>XE &quot;</span><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>SML</span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>family of functional programming languages, which is to use
  a <b>label </b>(sometimes confusingly called a <b>constructor function</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>constructor
  function</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>) to mark out the numbers within an <b>arith-expr</b>.
  <span style="mso-spacerun: yes">&nbsp;</span>Labels act as markers for the
  type-checker by unambiguously signalling the types of the objects they label.
  Figure 11.11 introduces the label <b>num</b> as a way of marking out numbers.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(datatype<span
  style="mso-spacerun: yes">&nbsp; </span>arith-expr<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span><u>X : number &gt;&gt; Y : A;<u3:p></u3:p></u></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[num X] : arith-expr &gt;&gt; Y : A;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span><u>X : number;</u></span><u3:p></u3:p></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[num X] : arith-expr; <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>if (element? Op [+ - * /])<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>X : arith-expr; Y : arith-expr;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>======================<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X Op Y] : arith-expr;)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style="mso-spacerun: yes">&nbsp;</span><u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure 11.11
  Using labels<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>This solution works with the following
  definition of <b>do-calculation</b>.</span><span class=MsoFootnoteReference><span
  lang=EN-GB style='font-family:Wingdings;mso-ansi-language:EN-GB'> <a
  style='mso-footnote-id:ftn4' href="#_ftn4" name="_ftnref4" title="">0</a><u3:p></u3:p></span></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span><b><span
  lang=EN-GB style='mso-ansi-language:EN-GB'><br clear=all style='mso-special-character:
  line-break;page-break-before:always'>
  </span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>(define
  do-calculation<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>{arith-expr - -&gt; number}<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>[X + Y] -&gt; (+
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>[X - Y] -&gt; (-
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>[X * Y] -&gt; (* (do-calculation
  X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>[X / Y] -&gt; (/
  (do-calculation X) (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>[num X] -&gt; X)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure 11.12
  A type secure version of do-calculation<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><u><span
  lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>11.7 Verified_Objects_______________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>The use of labels in our <b>do-calculation</b>
  program makes for confusing reading - typing <b>in [[num 2] + [num 3]]</b> is
  a counterintuitive way of adding 2 and 3.<span style="mso-spacerun:
  yes">&nbsp; </span><b>Verified objects </b>make life easier.<span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>A verified object is an object
  that belongs to the type <b>verified</b>.<span style="mso-spacerun:
  yes">&nbsp; </span>The inhabitation rule for this type is:<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>X : <b>verified</b>
  just when the normal form of X is <b>true</b>.<u3:p></u3:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Unlike the other types so far
  encountered, the type verified is non-decidable; that is, there is no
  decision procedure for deciding whether an object belongs to this type or
  not.<span style="mso-spacerun: yes">&nbsp; </span>Consequently none of the
  self-evaluating objects of Qi will be recognised as belonging to this type -
  not even <b>true</b>!<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>At this point you will wonder what
  the point of such a type is: actually, this type is very useful.<span
  style="mso-spacerun: yes">&nbsp; </span>It allows us to write a nicer <b>do-calculation</b>
  program.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>When Qi typechecks definitions
  that include guards, it assumes that if the rule fires, then the guard must
  evaluate to <b>true</b> and hence Qi assumes that, in that circumstance, the
  guard is of the type<b> verified</b>.<span style="mso-spacerun: yes">&nbsp;
  </span>For instance, we can assume that if an input <b>X </b>passes the guard
  <b>(number? X)</b> (which tests for numberhood) that <b>X</b> is a number so,
  we can write:<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>________________________________<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(number? X) : verified &gt;&gt; X
  : number; <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>If we insert this rule in the
  datatype rules for <b>arith-expr</b>, and place a guard in the <b>do-calculation</b>
  function, then the whole thing typechecks.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style="mso-spacerun: yes">&nbsp;</span><u3:p></u3:p></span><b><span
  lang=EN-GB style='mso-ansi-language:EN-GB'><br clear=all style='mso-special-character:
  line-break;page-break-before:always'>
  </span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(datatype<span
  style="mso-spacerun: yes">&nbsp; </span>arith-expr<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>_______________________________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>(number? X) : verified &gt;&gt; X : number; <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span><u>X : number;<u3:p></u3:p></u></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>X : arith-expr;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>if (element? Op [+ - * /])<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>X : arith-expr; Y : arith-expr;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>=====================<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X Op Y] : arith-expr;)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(define do-calculation<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>{arith-expr - -&gt; number}<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X + Y] -&gt; (+ (do-calculation X)
  (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X - Y] -&gt; (- (do-calculation X) (do-calculation
  Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X * Y] -&gt; (* (do-calculation X)
  (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>[X / Y] -&gt; (/ (do-calculation X)
  (do-calculation Y))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>X -&gt; X<span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
  where (number? X))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure 11.13
  A type secure version of do-calculation using verified objects<u3:p></u3:p></span></i></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><u><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>11.8 Defining Type Operators________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'>The operators
  list</span><!--[if supportFields]><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt;mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span> </span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt'>XE &quot;</span><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";letter-spacing:
  -.1pt;mso-ansi-language:EN-GB'>list</span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt;mso-ansi-language:EN-GB'>, </span><span lang=EN-GB
  style='font-family:Symbol;letter-spacing:-.1pt;mso-ansi-language:EN-GB'>�</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'> and * are
  the base type operators</span><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt'> XE &quot;</span><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'>type operator</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>of Qi, but datatype refinement</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt;mso-ansi-language:
  EN-GB'>refinement</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>rules allow the introduction of new type operators</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt;mso-ansi-language:
  EN-GB'>type operator</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt;mso-ansi-language:EN-GB'>. As an example, we shall
  consider <b>stream</b></span><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt;mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt'> XE &quot;</span><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'>stream</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt'>&quot; </span><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt;mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt;mso-ansi-language:
  EN-GB'><span style='mso-bidi-font-weight:bold'>s</span></span></b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'>.<span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>Streams are a device used by
  functional programmers for</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'> manipulating
  <span style='letter-spacing:-.1pt'>infinite</span></span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:-.1pt'> XE &quot;</span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'>infinite</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:-.1pt;mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.1pt;mso-ansi-language:EN-GB'>ly large collections of objects
  without having to generate each element of them.<span style="mso-spacerun:
  yes">&nbsp; </span>A stream requires an ordering of the elements of the
  collection such that <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>1.</span><span lang=EN-GB
  style='font-size:7.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>There is a first element of this
  ordering <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>2.</span><span lang=EN-GB
  style='font-size:7.0pt;mso-ansi-language:EN-GB'>&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>For element in the ordering there
  is a a computable</span><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span> </span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>XE
  &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>computable</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>method for finding the unique next element in the ordering.
  <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Thus suppose we wish to work with
  a stream</span><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>stream</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>that represents the set of natural numbers. There are an
  infinite</span><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>infinite</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>number of natural numbers and so it is impossible to place
  them in a finite list</span><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>list</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>. However they may be represented
  as a stream in which the first element is the number 0 and <i>f </i>is the
  function (+ 1) that adds 1 to any natural number.<span style="mso-spacerun:
  yes">&nbsp; </span>The stream of natural numbers can represented as the tuple</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>tuple</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>&lt;0, (+ 1)&gt;. <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>By means of the appropriate
  functions, this representation can be made to behave like an infinite</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>infinite</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>ly long list</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>list</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>of natural numbers.<span style="mso-spacerun: yes">&nbsp;
  </span>In chapter 4 we saw that a list could be decomposed through the head
  and tail functions.<span style="mso-spacerun: yes">&nbsp; </span>If stream</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>stream</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>s can act as proxies for lists,
  then the corresponding versions <b>stream-head</b> and <b>stream-tail</b>
  should be definable. Intuitively, the tail of the stream of the natural
  numbers beginning with 0 will be the stream of natural numbers beginning with
  1 (i.e. stream-tail(&lt;0, (+ 1)&gt;) = &lt;1, (+ 1)&gt;) and the <b>stream-head</b>
  of the stream of natural numbers beginning with 0 is just 0 (i.e.
  stream-head(&lt;0, (+ 1)&gt;) = 0).<span style="mso-spacerun: yes">&nbsp;
  </span>This operation can be generalised; the tail of a stream &lt;X, <i>f</i>&gt;
  is the stream &lt;(<i>f</i> X), <i>f</i>&gt; formed by pairing the result of
  applying the stream function to the initial element of the stream with the
  stream function itself.<span style="mso-spacerun: yes">&nbsp; </span>The head
  of a stream &lt;X, <i>f</i>&gt; is just X.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>In Qi stream</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>stream</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>s are plausibly identified as
  tuple</span><!--[if supportFields]><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>tuple</span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>s of elements and functions of the
  right type.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>Since it is
  possible to construct streams for natural numbers, characters etc., we can
  meaningfully talk of streams of natural numbers, strings and characters.<span
  style="mso-spacerun: yes">&nbsp; </span>Streams are then a polytyp</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>polytyp</span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>e</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>e operation over types. The
  functions <b>stream-head</b> and <b>stream-tail</b> can then be defined as
  well (figure 11.14). <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(datatype stream</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>stream</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>X : (A * (A </span></b><b style='mso-bidi-font-weight:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:1.0pt;mso-ansi-language:
  EN-GB'>--</span></b><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&gt; A));<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>==============<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>X : (stream</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>stream</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>A);)<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span
  style="mso-spacerun: yes">&nbsp;</span><u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(define stream-tail<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>{(stream A) </span></b><b style='mso-bidi-font-weight:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:1.0pt;mso-ansi-language:
  EN-GB'>--</span></b><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&gt; (stream
  A)}<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>(@p X F) -&gt; (@p (F X) F))<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(define stream-head<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>{(stream A) </span></b><b style='mso-bidi-font-weight:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";letter-spacing:1.0pt;mso-ansi-language:
  EN-GB'>--</span></b><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&gt; A}<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>(@p X F) -&gt; X)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <h2 style='margin-left:.5in'><span lang=EN-GB style='font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Figure
  11.14<span style="mso-spacerun: yes">&nbsp; </span>Streams as a datatype in </span><span
  lang=EN-GB style='font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";font-style:normal'>Qi<u3:p></u3:p></span></h2>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><i><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><u><span
  lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>11.9 Working with Functions Other than Cons__<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>Using the square brackets [ and ]
  to write refinement</span><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>refinement</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>rules is only a notational convenience; we could choose to
  write <b>(cons X (cons Y Z))</b> instead of <b>[X Y | Z] </b>in the
  definition of <b>binary</b></span><!--[if supportFields]><span lang=EN-GB
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Verdana;
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span>
  XE &quot;<span lang=EN-GB style='mso-ansi-language:EN-GB'>binary</span>&quot;
  <![endif]--><!--[if supportFields]><span lang=EN-GB style='font-size:9.0pt;
  mso-bidi-font-size:10.0pt;font-family:Verdana;mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style="mso-spacerun: yes">&nbsp;</span>and the
  refinement rules would work in exactly the same way.<span
  style="mso-spacerun: yes">&nbsp; </span>Moreover the function <b>cons </b>is
  only one particular constructor, and there is no reason why a datatype
  definition should be restricted to working with just that one constructor.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>As a case study we will consider
  developing a datatype definition for the natural numbers.<span
  style="mso-spacerun: yes">&nbsp; </span>We could use a successor notation,
  whereby 3 is defined<b> </b>as <b>[succ [succ [succ 0]]]</b>, but this is a
  clumsy representation when even moderately sized numbers are involved.<span
  style="mso-spacerun: yes">&nbsp; </span>Instead of this, we will use the
  conventional decimal representation of the natural numbers.<span
  style="mso-spacerun: yes">&nbsp; </span>Our datatype definition contains
  three rules; the first states that anything is a natural number if it is an
  integer greater than -1.<span style="mso-spacerun: yes">&nbsp; </span>The
  second says that the result of adding 1<b style='mso-bidi-font-weight:normal'>
  </b>to a natural number is also a natural number.<span style="mso-spacerun:
  yes">&nbsp; </span>The last says that subtracting 1 from a natural number is
  also a natural number if that number is not 0.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>(datatype
  natnum<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>if (and
  (integer? X) (&gt; X -1))<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>___________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>X : natnum;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>X : natnum;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>___________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>(+ X 1) :
  natnum;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>(not (= X 0))
  : verified;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>X : natnum;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>___________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>(- X 1) :
  natnum;)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal align=center style='margin-right:-.35pt;text-align:center;
  mso-outline-level:1'><i style='mso-bidi-font-style:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>Figure 11.15 Defining the datatype of natural
  numbers<o:p></o:p></span></i></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>The definition of addition over
  natural numbers is now straightforward.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(define plus<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp; </span>{natnum </span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";letter-spacing:1.0pt;mso-ansi-language:EN-GB'>--</span></b><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&gt;<span
  style='mso-bidi-font-weight:bold'> natnum </span><span style='letter-spacing:
  1.0pt'>--</span>&gt; natnum}<span style='mso-bidi-font-weight:bold'><o:p></o:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>0 X -&gt; X<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>X Y -&gt; (plus (- X 1) (+ Y 1) )<span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>where
  (not (= X 0))<span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>)</span></b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal align=center style='margin-right:-.35pt;text-align:center;
  mso-outline-level:1'><i style='mso-bidi-font-style:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>Figure 11.16 Defining natural number addition<o:p></o:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b style='mso-bidi-font-weight:normal'><u><span lang=EN-GB
  style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>11.10
  Subtypes________________________<o:p></o:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'>One
  problem with the addition program of the previous section is that it does not
  work in hand with our other arithmetical operations.<span
  style="mso-spacerun: yes">&nbsp; </span>This is a disadvantage, because the
  operations that return natural numbers should be able to return objects to
  functions that accept numbers.<span style="mso-spacerun: yes">&nbsp;
  </span>This is because natural numbers are a </span><b style='mso-bidi-font-weight:
  normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>subtype</span></b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'> or
  special case of the type of all numbers.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'>We want
  to be able to enter </span><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(- (plus 34 5) 7.5)</span></b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'> and get
  it past the typechecker without disturbing our datatype rules.<span
  style="mso-spacerun: yes">&nbsp; </span>To this we define the concept of a
  subtype and add that natural numbers are a subtype of numbers.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>(datatype subtype<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style="mso-spacerun: yes">&nbsp;</span>(subtype B A); X : B;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style="mso-spacerun: yes">&nbsp;</span>_____________________ <o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style="mso-spacerun: yes">&nbsp; </span>X : A;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>_____________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>(subtype natnum number);<span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp; </span>)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'>If we
  now enter </span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>(- (plus 34 5) 7.5)</span></b><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'> then we get </span><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>31.5 : number</span></b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB;mso-bidi-font-weight:bold'>.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify;mso-outline-level:
  1'><b style='mso-bidi-font-weight:normal'><u><span lang=EN-GB
  style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;mso-outline-level:
  1'><b><u><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>11.11 Type Checking Assignments____________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>If a global</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>global</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>variable is used in conjunction</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>conjunction</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>with strong typing in Qi then it requires a refinement</span><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><b style='mso-bidi-font-weight:normal'><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>refinement</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>rule that states what type of object the global identifier
  holds. The expression <b>(set *my-name* mark)</b> will not typecheck unless
  it is stated within a datatype definition what is the type of <b>(value</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>value</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; \b </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>*my-name*)</span></span></b><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>.<span style="mso-spacerun: yes">&nbsp;
  </span>Arrays are declared in this way.<span style="mso-spacerun: yes">&nbsp;
  </span>So to declare the array</span><!--[if supportFields]><span lang=EN-GB
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>array</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'><span style='mso-element:field-end'></span></span><![endif]--><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'><span style="mso-spacerun:
  yes">&nbsp;</span>of chapter 6, we declare the type of the expression <b>(value
  *ordinance-survey*) </b>to be an array of symbols<b> </b>(figure 11.16).<a
  style='mso-footnote-id:ftn5' href="#_ftn5" name="_ftnref5" title=""><span
  class=MsoFootnoteReference><span style='mso-special-character:footnote'><![if !supportFootnotes]>[2]<![endif]></span></span></a><span
  class=MsoFootnoteReference>[2]<u3:p></u3:p></span></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(datatype some_global</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>global</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'>_objects<u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>_______________________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(value</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>value</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; \b </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>*my-name*) : symbol;<u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>____________________________________<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>(value</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>value</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; \b </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>*ordinance-survey*) : (array</span></span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span></b><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> XE &quot;</span></b><b style='mso-bidi-font-weight:normal'><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>array</span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span>symbol);)<u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  lang=EN-GB style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center;
  mso-outline-level:1'><i><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Figure 11.17
  Declaring the types of<span style="mso-spacerun: yes">&nbsp; </span>some
  global objects<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><u><span
  style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>11.12
  Structures___________________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Suppose
  we want to define a ship as a type with the following component parts; the
  name - which is a string of some kind; the nationality - which is a symbol;
  the tonnage - which is a number and the length - which is also a number. The
  type <b>ship</b> could be defined as a datatype</span><!--[if supportFields]><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-begin'></span> XE &quot;tuple&quot; </span><![endif]--><!--[if supportFields]><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-end'></span></span><![endif]--><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>,
  but it is better to define it as a <b>structure</b> (figure 11.18).<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(structure</span></b><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-begin'></span>
  XE &quot;structure&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-bidi-font-weight:
  bold'><span style="mso-spacerun: yes">&nbsp;</span>ship <u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>name string <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>nationality symbol <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>tonnage number <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>length number)</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><i><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Figure
  11.18 Defining a ship as a structure</span></i><!--[if supportFields]><i
  style='mso-bidi-font-style:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-begin'></span></span></i><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;<b style='mso-bidi-font-weight:normal'>structure</b>&quot; </span><![endif]--><!--[if supportFields]><i
  style='mso-bidi-font-style:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-end'></span></span></i><![endif]--><i
  style='mso-bidi-font-style:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-bidi-font-style:
  italic'><span style="mso-spacerun: yes">&nbsp;</span>in </span></span></i><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Qi</span><o:p></o:p></p>
  <u3:p></u3:p>
  <p class=MsoNormal align=center style='margin-top:0in;margin-right:-.35pt;
  margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;text-align:center'><i><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></i></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>What
  does <b>structure</b></span><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'><span style='mso-element:field-begin'></span> XE
  &quot;structure&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-bidi-font-weight:
  bold'><span style="mso-spacerun: yes">&nbsp;</span></span></span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>do?<span
  style="mso-spacerun: yes">&nbsp; </span>It creates a type <b>ship</b> with a <b>constructor</b>
  function</span><!--[if supportFields]><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-begin'></span>
  XE &quot;<b style='mso-bidi-font-weight:normal'>constructor function</b>&quot;
  </span><![endif]--><!--[if supportFields]><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-end'></span></span><![endif]--><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;</span><b>make-ship</b> of type<b> string </b></span><span
  style='font-family:Symbol'>� </span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(<b>symbol </b></span><span
  style='font-family:Symbol'>� </span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(<b>number </b></span><span
  style='font-family:Symbol'>� </span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(<b>number</b> </span><span
  style='font-family:Symbol'>�</span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> <b>ship)))</b> and the following <b>selector</b>
  functions. <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span><b><br
  clear=all style='mso-special-character:line-break;page-break-before:always'>
  </b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>1.</span><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>ship-name</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  of type <b>ship </b></span><span style='font-family:Symbol'>�</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  <b>string</b>, <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>2.</span><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>ship-nationality</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  of type <b>ship</b> </span><span style='font-family:Symbol'>�</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  <b>symbol</b>, <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>3.</span><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>ship-tonnage</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  of type <b>ship</b> </span><span style='font-family:Symbol'>� <span
  style="mso-spacerun: yes">&nbsp;</span></span><b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>number</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>,
  <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>4.</span><b><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp; </span></b><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>ship-length</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  of type <b>ship </b></span><span style='font-family:Symbol'>� </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>number,
  &#8230;.<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>5.</span><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&#8230;.
  and a <b>recognisor </b>function <b>ship?</b> of type <b>A</b> </span><span
  style='font-family:Symbol'>�</span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> boolean</span></b><!--[if supportFields]><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Verdana'><span
  style='mso-element:field-begin'></span></span> XE &quot;<b style='mso-bidi-font-weight:
  normal'>boolean</b>&quot; <![endif]--><!--[if supportFields]><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Verdana'><span
  style='mso-element:field-end'></span></span><![endif]--><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;</span>that recognises ships <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Figure
  11.19 shows an example of their use.<a style='mso-footnote-id:ftn6'
  href="#_ftn6" name="_ftnref6" title=""><sup><span style='mso-special-character:
  footnote'><![if !supportFootnotes]>[3]<![endif]></span></sup></a><sup>[3]</sup><u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(1+)
  (structure</span></b><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'><span style='mso-element:field-begin'></span> XE
  &quot;structure&quot; </span></b><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-bidi-font-weight:
  bold'><span style="mso-spacerun: yes">&nbsp;</span>ship <u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>name string<span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span style="mso-spacerun: yes">&nbsp;</span><u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>nationality
  symbol<span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style="mso-spacerun: yes">&nbsp;</span><u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>tonnage number<span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun:
  yes">&nbsp;</span><u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>length number) <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>ship<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(2+)
  (make-ship &quot;Sea Venus&quot; Greek 1055.9 568.8)<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:-.2pt'>#&lt;ship :name Sea Venus :nationality Greek :tonnage
  1055.9 :length 568.8&gt; : ship<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(3+)
  <span style='letter-spacing:-.2pt'>(ship-tonnage (make-ship &quot;Sea
  Venus&quot; Greek 1055.9 568.8))<u3:p></u3:p></span></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>1055.9
  : number<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify;text-indent:
  14.2pt'><span style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <h2 style='margin-left:.5in'><span lang=EN-GB style='font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Figure
  11.19 Defining and using a structure<u3:p></u3:p></span></h2>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Structures
  are useful for several reasons.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>1.</span><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>They
  automatically generate for us a batch of constructor, selector and recognisor
  functions that we might otherwise have to define ourselves.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>2.</span><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>They
  allow efficient processing, instead of having to rely on functions that
  contain pattern-matching</span><!--[if supportFields]><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-begin'></span> XE &quot;pattern-matching&quot; </span><![endif]--><!--[if supportFields]><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-end'></span></span><![endif]--><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>,
  we can access the appropriate parts of the type using selector functions. <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>3.</span><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>They
  allow us to redefine types without problems. If later we decide that the type
  <b>ship</b> is to include an extra slot called <b>horsepower</b> of type
  number, then we simply add it without disturbing our other selector functions
  which behave in the same way as they did before.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:57.75pt;margin-bottom:.0001pt;text-align:justify;text-indent:
  -21.75pt;mso-list:l0 level1 lfo2;tab-stops:list 57.75pt'><![if !supportLists]><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>4.<span
  style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></span><![endif]><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>Unlike datatypes, the speed of
  typechecking is invariant of the number of structure</span><!--[if supportFields]><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-begin'></span> XE &quot;structure&quot; </span><![endif]--><!--[if supportFields]><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-end'></span></span><![endif]--><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>s
  declared.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>More structures
  do not slow typechecking. <u3:p></u3:p><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>One
  glitch with structures (inherited from Lisp) is that <b>=</b> and <b>==</b>
  always return <b>false</b> for structures.<span style="mso-spacerun:
  yes">&nbsp; </span>To compare two structures, you need to define a function
  that compares structures on the basis of the equality of their components.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><u><span style='font-size:14.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>11.13 Abstract Data Types____________________<o:p></o:p></span></u></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Structures
  are powerful because they allow us to hide away inessential information about
  how objects are represented and make changes easily; a technique called <b>information
  hiding</b>.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>Their
  disadvantage is that they only cater for objects with a fixed number of
  components.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>But if we want
  to use the techniques of information hiding with respect to objects that are
  recursively defined, and that can be of any size, then we have to use <b>abstract
  data types</b>.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>A
  good example is a stack. A stack is a structure into which objects are placed
  or <b>pushed </b>one by one.<span style="mso-spacerun: yes">&nbsp;
  </span>Objects can also be removed or <b>popped </b>one by one.<span
  style="mso-spacerun: yes">&nbsp; </span>The basic rule governing stacks is
  that the object popped is the last object that was pushed onto the
  stack.<span style="mso-spacerun: yes">&nbsp; </span>A concrete example is a
  the magazine of a rifle, in which the last bullet pushed into the magazine is
  the first to be fired.<span style="mso-spacerun: yes">&nbsp; </span>The stack
  can be empty or it can contain any number of elements.<span
  style="mso-spacerun: yes">&nbsp; </span>This last observation means that we
  cannot use structures, which rely on knowing that the stack will only have a
  fixed finite number of components.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>However
  we can approach the problem of defining stacks using the same philosophy as
  we found in structures; that is, we define stacks by (a) defining the
  appropriate constructor, selector and recognisor functions and stating how
  they behave and<span style="mso-spacerun: yes">&nbsp; </span>(b) defining
  their types.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>The
  simplest stack is the empty stack; a stack with no elements.<span
  style="mso-spacerun: yes">&nbsp; </span>Let us define a 0-place function <b>(empty-stack)</b>
  that returns the empty-stack.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(define empty-stack<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-&gt;
  &quot;e!&quot;)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>We
  have chosen <b>&quot;e!&quot;</b> as the empty stack; the choice is
  arbitrary.<span style="mso-spacerun: yes">&nbsp; </span>The function <b>push</b>
  pushes an element onto a stack.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(define push<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>X S -&gt; [X ++ S])<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>pop</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  removes the element at the top of the stack and returns the rest of the
  stack.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(define pop<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>X -&gt; (error &quot;empty stack!&quot;) <span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>where
  (= X (empty stack))<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>[X ++ S] -&gt; S)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Finally
  <b>top</b> returns the top of the stack.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(define top<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp; </span>X -&gt; (error &quot;empty stack!&quot;) where (= X (empty
  stack))<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp; </span>[X ++ S] -&gt; S)</span></b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>We
  need now to enter the types we want to associate with these functions.<span
  style="mso-spacerun: yes">&nbsp; </span>Since stacks, like streams, can
  contain elements of any kind, we need to define a stack as an operator over
  types.<span style="mso-spacerun: yes">&nbsp; </span>The empty stack is a
  polymorphic object of type (stack A).<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>____________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(empty-stack) : (stack A);<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>push</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  pushes an object of type A onto a stack of type (stack A).<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>__________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>push : (A --&gt; (stack A) --&gt; (stack A));<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>top</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  returns an element of type A from a stack of type A.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>_________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>top
  : ((stack A) --&gt; A)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Finally
  <b>pop</b> returns a stack of type A given a stack of type A.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify;text-indent:
  .5in'><b style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>________________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>pop
  : ((stack A) --&gt; (stack A));<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Rather
  than scattering all this material over the program, it is better to draw it
  together into one place. The <b>abstype</b> declaration does precisely this
  (figure 11.20) .<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(abstype stack<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(:types<span style="mso-spacerun:
  yes">&nbsp; </span>___________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>(empty-stack)
  : (stack A);<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-size:8.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>__________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>push : (A --&gt; (stack A) --&gt; (stack A));<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></b><b
  style='mso-bidi-font-weight:normal'><span style='font-size:8.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span>_________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>top
  : ((stack A) --&gt; A);<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-size:8.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>________________________<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>pop
  : ((stack A) --&gt; (stack A));<span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(:defs<span style='mso-tab-count:
  1'>&nbsp; </span>(define empty-stack<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-&gt;
  &quot;e!&quot;)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-size:8.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp; </span>(define push<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>X
  S -&gt; [X ++ S])<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-size:8.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp; </span>(define top<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='mso-tab-count:
  2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>X
  -&gt; (error &quot;empty stack!&quot;) where (=<span style="mso-spacerun:
  yes">&nbsp; </span>X (empty stack))<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style="mso-spacerun: yes">&nbsp;</span>[X ++ S] -&gt; X)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-size:8.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp; </span>(define pop<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style="mso-spacerun: yes">&nbsp;</span>X -&gt; (error &quot;empty
  stack!&quot;) where (= X (empty stack))<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[X
  ++ S] -&gt; S)<span style='mso-tab-count:1'>&nbsp; </span>)<span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>)</span></b><b
  style='mso-bidi-font-weight:normal'><u><span style='font-size:14.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> <o:p></o:p></span></u></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><u><span style='font-size:8.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></u></b></p>
  <p class=MsoNormal align=center style='margin-right:-.35pt;text-align:center'><i
  style='mso-bidi-font-style:normal'><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>Figure 11.20 Defining a stack as an
  abstract datatype</span></i><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(1+)
  (empty-stack)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;e!&quot;
  : (stack A)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(2+)
  (push 0 (empty-stack))<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>[0<span
  style="mso-spacerun: yes">&nbsp; </span>++ &quot;e!&quot;] : (stack number)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(3+)
  (top [0<span style="mso-spacerun: yes">&nbsp; </span>++ &quot;e!&quot;])<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>type
  error<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>The
  final input fails, because the type checker has no understanding on what a
  stack is apart from the operations used to build it.<span
  style="mso-spacerun: yes">&nbsp; </span>We try again<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(4+)
  (top (push 0 (empty-stack)))<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>0
  : number<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>The
  example shows that for Qi, the actual concrete representation for an abstract
  datatype like stack is not used in the type checker.<span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>So although our empty stack is
  a string, the command <b>(output (empty-stack))</b> will not type check
  (though <b>(output &quot;~A&quot; (empty-stack))</b> will).<span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>Our stacks must be handled by
  means of the constructor, accessor and recognisor functions that we have laid
  down.<span style="mso-spacerun: yes">&nbsp; </span>Here is an example.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(define
  empty-stack?<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp; </span>{(stack A) --&gt; boolean}<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>Stack -&gt; (= Stack
  (empty-stack)))<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><u><span style='font-size:14.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>11.14 Changing the Type Environment___________________<o:p></o:p></span></u></b></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Every
  time a datatype is declared, the type environment of Qi changes. The natural progression
  is that the type environment grows larger.<span style="mso-spacerun:
  yes">&nbsp; </span>As this process proceeds, the performance of the
  typechecker degrades in a roughly linear relation to the number of type rules
  in the system.<span style="mso-spacerun: yes">&nbsp; </span>If the number of
  rules approaches several hundred, then the type checker can become very slow,
  particularly on large function definitions.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Generally
  in such large systems, with a great many types in use, the system is
  generally the product of more than one hand.<span style="mso-spacerun:
  yes">&nbsp; </span>In such a case, the programmer working on one part of the
  system might actually use only a fragment of the type discipline of the whole
  system.<span style="mso-spacerun: yes">&nbsp; </span>Nevertheless, the type
  checker, unless instructed, will slog through the program armed with the
  entire type system.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>The
  commands <b>preclude</b>, <b>include</b>, <b>preclude-all-but</b> and <b>include-all-but</b>
  allow the programmer to optimise the type checker to the program at
  hand.<span style="mso-spacerun: yes">&nbsp; </span>Thus it is possible to
  have a massive type system in Qi and programs of many thousands of lines, and
  yet type check them in reasonable speed by configuring the type checker to
  ignore those types whose rules are not needed.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>The
  command <b>preclude</b> accepts a list of symbols which are names of
  datatypes and sets them aside from use in type checking.<span
  style="mso-spacerun: yes">&nbsp; </span>Placing the command <b>(preclude
  [streams])</b> at the head of a file will cause the type checker to ignore
  the rules for streams.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>The
  command <b>(include [streams])</b> works the opposite way, placing the rules
  back into the type environment.<span style="mso-spacerun: yes">&nbsp;
  </span>The command <b>(preclude-all-but [streams]) </b>will preclude all user
  defined datatypes apart from streams, whereas<b> (include-all-but [streams]) </b>will
  include all user defined datatypes apart from streams.<span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>Reasonably enough, <b>(preclude-all-but
  [ ]) </b>will set aside all<b> </b>user defined datatypes and <b>(include-all-but
  [ ]) </b>will include all of them.<span style="mso-spacerun: yes">&nbsp;
  </span><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Overwriting
  old datatype definitions (as opposed to simply setting them aside) with new
  ones can make previously type secure programs type insecure and is not
  encouraged.<span style="mso-spacerun: yes">&nbsp; </span>Qi warns over such
  attempts at redefinition.<span style="mso-spacerun: yes">&nbsp; </span>.<span
  style="mso-spacerun: yes">&nbsp; </span>Similarly redefining functions and changing
  their types will raise warning messages for the same reason.<span
  style="mso-spacerun: yes">&nbsp; </span>In both cases, if the user really
  wants to to be sure of type security, the proper course is to exit and start
  from scratch.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b
  style='mso-bidi-font-weight:normal'><u><span style='font-size:14.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>11.15 Optimising Search_______________________________</span></u></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>The
  default Qi search strategy is to use every user-defined rule and, on failure,
  to backtrack to the last rule used to see if it can be legally applied in a
  different way and if not, to try the next one.<span style="mso-spacerun:
  yes">&nbsp; </span>This is pretty much the chronological backtracking approach
  described in chapter 7.<span style="mso-spacerun: yes">&nbsp; </span>It is
  possible to change this strategy by use of the keyword <b>commit! </b>placed
  before a rule (e.g.). <o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(datatype l_formula<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>commit!<span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>X : l_formula; Y : l_formula;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>=====================<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp; </span>[@p X Y] : l_formula;<span style="mso-spacerun:
  yes">&nbsp; </span><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>...... ...... ...... ......)<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-left:.5in'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>The
  effect of this keyword is that if the rule is successfully applied, the type
  checker does not, on later failure, backtrack to that choicepoint or any
  other rules within that datatype. <b>commit!</b> has to be used with some
  caution as it can, if wrongly applied, block the verification of a type
  secure program.<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><b><u><span
  style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>Exercise
  11________________________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>1.</span><span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Define the
  following enumeration</span><!--[if supportFields]><span style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;<b style='mso-bidi-font-weight:normal'>enumeration</b>&quot; </span><![endif]--><!--[if supportFields]><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-end'></span></span><![endif]--><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>types.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.15pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>a.</span><span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><b><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>coin</span></b><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  for British coinage and type-check the </span><b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>next-denomination</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> function in chapter 3 using this
  type (count 0 as of type </span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>coin</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> for this question). <span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><u3:p></u3:p></span><span
  style="mso-spacerun: yes">&nbsp;</span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.15pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>b.</span><span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><b><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>fruit</span></b><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  and </span><b><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>winnings</span></b><span style='font-size:9.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> for the fruit-machine of chapter 2 so that winnings are
  numbers which represent potential wins from the machine. <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.15pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><u3:p></u3:p></span><span
  style="mso-spacerun: yes">&nbsp;</span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>2.</span><span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Define a type </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>formula</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> for Proplog</span><!--[if supportFields]><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>Proplog</span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-end'></span></span><![endif]--><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>formulae so that </span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>p</span></b><span style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>, </span><b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>[p &lt;= [q
  &amp; r]]</span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  etc. are all of type </span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>formula. </span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>Using your answer, build an interactive Proplog system that
  enables the user to enter a goal to your system and applies backward chaining
  to solve it.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>3.</span><span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>*Define </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>set</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> as a type operator such that </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>X
  : (set A)</span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  just when </span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>X</span></b><span style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> is a list of </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>A</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>s with no duplicated elements.<span
  style="mso-spacerun: yes">&nbsp; </span><span style="mso-spacerun:
  yes">&nbsp;</span><u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>a.<span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Define a function </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>coerce-to-set</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> of type </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>[A]</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> </span><span style='font-size:9.0pt;
  mso-bidi-font-size:12.0pt;font-family:Symbol'>� </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(set
  A) </span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>that
  acts as<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>an identity
  function if it receives an object of type </span><b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(set A)</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> and if it<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>does not returns
  an error message</span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>.<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.15pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>b.<span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>Define a function </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>acons</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> of type </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>A
  </span></b><span style='font-size:9.0pt;mso-bidi-font-size:12.0pt;font-family:
  Symbol'>� </span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(set A) </span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'>� </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(set
  A)</span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  that receives an<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.15pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>object </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>O</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> and a list of objects </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>L</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> and conses </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>O</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> to </span><b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>L</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> provided </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>O</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> is not an <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.15pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>element of</span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp; </span>L</span></b><span style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>.<span style="mso-spacerun:
  yes">&nbsp; </span></span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>If O </span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>is an element of</span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  L</span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>, </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>acons
  </span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>returns</span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  L.<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.15pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>c.</span><span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Define
  functions</span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> hd</span></b><span style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> and </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>tl</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> that act as </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>head</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> and</span><b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> tail</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>, but have the types<span
  style="mso-spacerun: yes">&nbsp; </span></span><b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(set A) </span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'>� </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>A
  </span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>and</span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  (set A) </span></b><span style='font-size:9.0pt;mso-bidi-font-size:12.0pt;
  font-family:Symbol'>� </span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(set A) </span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>respectively.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>d.<span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Define</span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  set-union </span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>of
  type</span><b><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'> (set A) </span></b><span style='font-size:9.0pt;
  mso-bidi-font-size:12.0pt;font-family:Symbol'>� </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(set
  A) </span></b><span style='font-size:9.0pt;mso-bidi-font-size:12.0pt;
  font-family:Symbol'>� </span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(set A) </span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>that<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:49.5pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp;</span>unions sets together.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:68.15pt;margin-bottom:.0001pt;text-align:justify;text-indent:
  -.25in;mso-list:l1 level1 lfo4;tab-stops:list 32.15pt'><![if !supportLists]>e.<span
  style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><![endif]><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>e.</span><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>Define </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>set-intersection
  </span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>of type</span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  (set A) </span></b><span style='font-size:9.0pt;mso-bidi-font-size:12.0pt;
  font-family:Symbol'>� </span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(set A) </span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'>� </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(set
  A) </span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>that
  gives the</span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> </span></b><span style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>intersection<span
  style="mso-spacerun: yes">&nbsp; </span>of two sets. <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:68.15pt;margin-bottom:.0001pt;text-align:justify;text-indent:
  -.25in;mso-list:l1 level1 lfo4;tab-stops:list 32.15pt'><![if !supportLists]>f.<span
  style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><![endif]><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>f.</span></b><b><span
  style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>Define </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>set-difference
  </span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>of type</span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  (set A) </span></b><span style='font-size:9.0pt;mso-bidi-font-size:12.0pt;
  font-family:Symbol'>� </span><b><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>(set A) </span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol'>� </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(set
  A) </span></b><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>that
  gives the difference of two sets. <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.15pt;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify;text-indent:
  -18.75pt;mso-list:l2 level1 lfo6;tab-stops:list 54.75pt'><![if !supportLists]><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></span><![endif]><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>*Rewrite
  the cribbage program set in exercise 4.8, so that it is type-checked.<span
  style="mso-spacerun: yes">&nbsp; </span>A card like </span><span lang=EN-GB
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>J</span><span
  style='mso-bidi-font-size:12.0pt;font-family:Symbol'>� </span><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>can be represented as a pair (@p 11
  hearts) composed of a number indicating rank and the symbol showing the
  suit.<span style="mso-spacerun: yes">&nbsp; </span>Define </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>rank</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> and </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>suit</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> as enumeration types and </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>card</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> as a synonym</span><!--[if supportFields]><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>synonym</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  \b </span><![endif]--><!--[if supportFields]><span style='font-size:9.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'><span style='mso-element:field-end'></span></span><![endif]--><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>for pairs composed of a rank and a suit.<span
  style="mso-spacerun: yes">&nbsp; </span>Use the answer to 11.3 to ensure that
  players are not dealt duplicate cards.<u3:p></u3:p><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify;text-indent:
  -18.75pt;mso-list:l2 level1 lfo6;tab-stops:list 54.75pt'><![if !supportLists]><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>5.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></span><![endif]><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>What
  effect does <b>commit!</b> have in the following?<o:p></o:p></span></p>
  <p class=MsoNormal style='margin-right:-.35pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(datatype
  foo<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>commit!<span
  style="mso-spacerun: yes">&nbsp; </span><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span><u>X : number;<o:p></o:p></u></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>X : foo;<o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span><u>X : symbol;<o:p></o:p></u></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:54.75pt;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style="mso-spacerun: yes">&nbsp;&nbsp; </span>X : foo;)</span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>6.</span><span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>*The function </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>read-file-as-charlist</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> (see appendix A) reads the contents
  of a text file as a list of characters, returning that list as an
  output.<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>Given the
  following simple grammar.<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.75in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&lt;expr&gt;
  ::= &lt;number&gt; | (&lt;expr&gt; &lt;op&gt; &lt;expr&gt;) <u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.75in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&lt;op&gt;
  ::= + | - | * | /<u3:p></u3:p></span></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.75in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&lt;number&gt;
  ::= &lt;digit&gt; | &lt;digit&gt;^&lt;number&gt;<span style="mso-spacerun:
  yes">&nbsp; </span></span></b><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(^
  shows there is no space between digits)<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.75in;margin-bottom:.0001pt;text-align:justify'><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&lt;digit&gt;
  ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9</span></b><span style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:1.0in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.2pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>devise a function </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>read-exprs</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> of type </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>string</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> </span><span style='font-size:9.0pt;
  mso-bidi-font-size:10.0pt;font-family:Symbol'>�</span><span style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> </span><b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(list expr)</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> that reads in characters from a file
  and outputs expressions.<span style="mso-spacerun: yes">&nbsp; </span>If the
  file cannot be constructed as having only expressions in it, then </span><b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>read-exprs</span></b><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> should return an error message. <u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:50.2pt;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>7.</span><span style='font-size:7.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span><span lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'>**Read Wikstrom</span><!--[if supportFields]><span
  lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b style='mso-bidi-font-weight:
  normal'><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Wikstrom</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;</span>or Paulson</span><!--[if supportFields]><span
  lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-begin'></span></span><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b style='mso-bidi-font-weight:
  normal'><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Paulson</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span lang=EN-GB style='font-size:
  9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
  style="mso-spacerun: yes">&nbsp;</span>on Standard ML and design a <i>type-secure</i>
  <b>cross-compiler</b> from SML into core <span style='mso-bidi-font-style:
  italic'>Qi</span>.<span style="mso-spacerun: yes">&nbsp; </span>Your program
  should read in an ML program from a file as a list of characters (see
  read-file-as-charlist in appendix A) and either output the corresponding <span
  style='mso-bidi-font-style:italic'>Qi</span> program into a different file
  (see write-to-file in appendix A) or evaluate the output on the fly so as to
  compile the <span style='mso-bidi-font-style:italic'>Qi</span> code into the
  current image.<span style="mso-spacerun: yes">&nbsp; </span>You can ignore ML
  type definitions, but you need to decide what to do with ML constructor
  functions. The easiest course is to represent them as simple list
  constructions. <span style="mso-spacerun: yes">&nbsp;</span><u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>&nbsp;<u3:p></u3:p></span></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt'><b><u><span style='font-size:
  14.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>Further
  Reading___________________________<u3:p></u3:p></span></u></b></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal style='margin-top:0in;margin-right:-.35pt;margin-bottom:
  0in;margin-left:.5in;margin-bottom:.0001pt;text-align:justify'><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>The sequent based notation used to
  define types in Qi was introduced by <b>Gentzen</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Gentzen</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-end'></span></span></b><![endif]--><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-bidi-font-weight:bold'><span style="mso-spacerun:
  yes">&nbsp;</span></span></span></b><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>(1934)
  and <b>Diller</b></span><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;<b
  style='mso-bidi-font-weight:normal'>Diller</b>&quot; </span><![endif]--><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-end'></span></span></b><![endif]--><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>(1990) and <b>Duffy</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Duffy</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-end'></span></span></b><![endif]--><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>(1991) provide good introductions to the use of this
  notation in modern logic.<span style="mso-spacerun: yes">&nbsp;
  </span>Structures are part of Common Lisp, and Qi structures are a species of
  Lisp structure; see <b>Steele</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Steele</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  \b </span><![endif]--><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-end'></span></span></b><![endif]--><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>(1990) 468-489 for more details.<span style="mso-spacerun:
  yes">&nbsp;&nbsp;&nbsp; </span>Other languages like SML provide abstract datatypes
  for hiding implementation-dependent representations of data - see <b>Wikstrom</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Wikstrom</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-end'></span></span></b><![endif]--><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>(1988) and <b>Paulson</b></span><!--[if supportFields]><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-begin'></span></span></b><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> XE &quot;</span><b
  style='mso-bidi-font-weight:normal'><span style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Paulson</span></b><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><b style='mso-bidi-font-weight:
  normal'><span style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-element:field-end'></span></span></b><![endif]--><span
  style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>(1996) for more on this.<span style="mso-spacerun:
  yes">&nbsp; </span><b>Abelson</b> and <b>Sussman</b> (1996) provide an
  excellent discussion on the use of streams in programming. <u3:p></u3:p></span></p>
  <span lang=EN-GB style='font-size:12.0pt;font-family:"Times New Roman";
  mso-fareast-font-family:"Times New Roman";color:black;mso-ansi-language:EN-GB;
  mso-fareast-language:EN-US;mso-bidi-language:AR-SA'><br clear=all
  style='mso-special-character:line-break;page-break-before:always'>
  </span>
  <p><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  <p class=MsoNormal>&nbsp;<u3:p></u3:p></p>
  <p><br clear=all style='mso-special-character:line-break'>
  </p>
  <div class=MsoNormal><span style='font-size:12.0pt'>
  <hr size=1 width="33%" align=left>
  </span></div>
  <p class=MsoFootnoteText><a style='mso-footnote-id:ftn7' href="#_ftn7"
  name="_ftnref7" title=""><span class=MsoFootnoteReference><span
  style='font-family:Wingdings;mso-ascii-font-family:"Microsoft Sans Serif";
  mso-hansi-font-family:"Microsoft Sans Serif";mso-char-type:symbol;mso-symbol-font-family:
  Wingdings'><span style='mso-char-type:symbol;mso-symbol-font-family:Wingdings'>0</span></span></span></a><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  </span><span style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Qi
  Programs/Chap11/fruit.qi.<u3:p></u3:p></span></p>
  <p class=MsoFootnoteText><a style='mso-footnote-id:ftn8' href="#_ftn8"
  name="_ftnref8" title=""><span class=MsoFootnoteReference><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-special-character:footnote'><![if !supportFootnotes]>[4]<![endif]></span></span></span></a><span
  class=MsoFootnoteReference><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>[1]</span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  </span><span style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Inbuilt types
  and inbuilt type operators cannot be made synonyms</span><!--[if supportFields]><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>synonyms</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  \b </span><![endif]--><!--[if supportFields]><span style='font-size:8.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'><span style='mso-element:field-end'></span></span><![endif]--><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>.<span style="mso-spacerun:
  yes">&nbsp; </span>These are </span><b><span style='font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  letter-spacing:1.0pt'>--</span></b><b><span style='font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&gt;</span></b><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>, </span><b><span style='font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>*,
  list, array</span></b><span style='font-size:8.0pt;mso-bidi-font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>,<span
  style="mso-spacerun: yes">&nbsp; </span></span><b><span style='font-size:
  10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>goals</span></b><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'> and </span><b><span
  style='font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>goal-object</span></b><span style='font-size:8.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>.<u3:p></u3:p></span></p>
  <p class=MsoFootnoteText><a style='mso-footnote-id:ftn9' href="#_ftn9"
  name="_ftnref9" title=""><span class=MsoFootnoteReference><span lang=EN-GB
  style='font-family:Wingdings;mso-ansi-language:EN-GB'>0</span></span></a><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'> Qi
  Programs/Chap11/binary.qi<u3:p></u3:p></span></p>
  <p class=MsoFootnoteText><a style='mso-footnote-id:ftn10' href="#_ftn10"
  name="_ftnref10" title=""><span class=MsoFootnoteReference><span
  style='font-family:Wingdings'>0</span></span></a><span style='font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'> </span><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>Qi Programs/Chap11/calculator.qi<u3:p></u3:p></span></p>
  <p class=MsoFootnoteText><a style='mso-footnote-id:ftn11' href="#_ftn11"
  name="_ftnref11" title=""><span class=MsoFootnoteReference><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-special-character:footnote'><![if !supportFootnotes]>[5]<![endif]></span></span></span></a><span
  class=MsoFootnoteReference><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>[2]</span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  </span><span style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>Property list</span><!--[if supportFields]><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>list</span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>&quot;
  </span><![endif]--><!--[if supportFields]><span style='font-size:8.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'><span style='mso-element:field-end'></span></span><![endif]--><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>s</span><!--[if supportFields]><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-begin'></span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  XE &quot;</span><span lang=EN-GB style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Property
  lists</span><span style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman"'>&quot; </span><![endif]--><!--[if supportFields]><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style='mso-element:field-end'></span></span><![endif]--><span
  style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'><span style="mso-spacerun:
  yes">&nbsp;</span>cannot be typechecked in Qi.<u3:p></u3:p></span></p>
  <p class=MsoFootnoteText><a style='mso-footnote-id:ftn12' href="#_ftn12"
  name="_ftnref12" title=""><span class=MsoFootnoteReference><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'><span
  style='mso-special-character:footnote'><![if !supportFootnotes]>[6]<![endif]></span></span></span></a><span
  class=MsoFootnoteReference><span style='font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman"'>[3]</span></span><span
  style='font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>
  </span><span style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman"'>The expression
  </span><b><span lang=EN-GB style='font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>#&lt;ship
  :name Sea Venus :nationality greek :tonnage 1055.9 :length 568.8&gt;</span></b><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'> cannot
  itself</span><b><span lang=EN-GB style='font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'> </span></b><span
  lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>be
  evaluated.<span style="mso-spacerun: yes">&nbsp; </span>The normal form
  representation of</span><b><span lang=EN-GB style='font-size:10.0pt;
  font-family:"Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";
  mso-ansi-language:EN-GB'> </span></b><span lang=EN-GB style='font-size:8.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>structures depends on Lisp and is
  not readable as such by Qi.<span style="mso-spacerun: yes">&nbsp;
  </span>Hence </span><b><span lang=EN-GB style='font-size:10.0pt;font-family:
  "Microsoft Sans Serif";mso-bidi-font-family:"Times New Roman";mso-ansi-language:
  EN-GB'>make-ship is </span></b><span lang=EN-GB style='font-size:8.0pt;
  mso-bidi-font-size:10.0pt;font-family:"Microsoft Sans Serif";mso-bidi-font-family:
  "Times New Roman";mso-ansi-language:EN-GB'>used to refer to the structure </span><b><span
  lang=EN-GB style='font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>#&lt;ship
  :name Sea</span></b><span lang=EN-GB style='font-size:9.0pt;mso-bidi-font-size:
  10.0pt;font-family:Verdana;mso-ansi-language:EN-GB'> </span><b><span
  lang=EN-GB style='font-size:10.0pt;font-family:"Microsoft Sans Serif";
  mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'>Venus
  :nationality greek :tonnage 1055.9 :length 568.8&gt;.<u3:p></u3:p></span></b></p>
  </td>
 </tr>
</table>

</div>

<p class=MsoNormal><span style='font-size:12.0pt'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

</div>

<div style='mso-element:footnote-list'><![if !supportFootnotes]><br clear=all>

<hr align=left size=1 width="33%">

<![endif]>

<div style='mso-element:footnote' id=ftn1>

<p class=MsoNormal><a style='mso-footnote-id:ftn1' href="#_ftnref1" name="_ftn1"
title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn2>

<p class=MsoNormal><a style='mso-footnote-id:ftn2' href="#_ftnref2" name="_ftn2"
title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn3>

<p class=MsoNormal><a style='mso-footnote-id:ftn3' href="#_ftnref3" name="_ftn3"
title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn4>

<p class=MsoNormal><a style='mso-footnote-id:ftn4' href="#_ftnref4" name="_ftn4"
title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn5>

<p class=MsoNormal><a style='mso-footnote-id:ftn5' href="#_ftnref5" name="_ftn5"
title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn6>

<p class=MsoNormal><a style='mso-footnote-id:ftn6' href="#_ftnref6" name="_ftn6"
title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn7>

<p class=MsoNormal><a style='mso-footnote-id:ftn7' href="#_ftnref7" name="_ftn7"
title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn8>

<p class=MsoNormal><a style='mso-footnote-id:ftn8' href="#_ftnref8" name="_ftn8"
title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn9>

<p class=MsoNormal><a style='mso-footnote-id:ftn9' href="#_ftnref9" name="_ftn9"
title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn10>

<p class=MsoNormal><a style='mso-footnote-id:ftn10' href="#_ftnref10"
name="_ftn10" title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn11>

<p class=MsoNormal><a style='mso-footnote-id:ftn11' href="#_ftnref11"
name="_ftn11" title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

<div style='mso-element:footnote' id=ftn12>

<p class=MsoNormal><a style='mso-footnote-id:ftn12' href="#_ftnref12"
name="_ftn12" title=""></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

</div>

</body>

</html>
